<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.sinodata.bsm.common.vo.TopuConf"%>
<%@page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>应用系统新增</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<%@ include file="../include/common.jsp"%>
		<%@ include file="../include/form.jsp"%>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/default/select/jquery.image.select.css"  />
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/select/jquery.image.select.min.js"></script>
		<link rel="stylesheet"  type="text/css" href="${pageContext.request.contextPath}/style/default/select/jquery.multiselect.css" />
		<link rel="stylesheet"  type="text/css" href="${pageContext.request.contextPath}/style/default/jqueryui/jquery-ui.css" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-ui.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/select/jquery.multiselect.min.js"></script>
		<style type="text/css">
			.add_block {
				background-color: #ECF6FC; 
				width:533px;
				margin:8px 0px 0px 8px;
			}
	     	.ui-multiselect, .ui-multiselect span{
			   height:24px;
			   line-height:24px;
			   }
		</style>
		
		<script type="text/javascript">
			$(document).ready(function(){
				$('#topo').multiselect({
					noneSelectedText:'---请选择---',
					selectedList: 2
				});
			})
			function add(){
				$.ajax({
				   type: "POST", 
				   url: "${pageContext.request.contextPath}/appview/app!addDo.action", 
				   data: $("#resForm").serialize(), 
				   dataType: 'json',
				   success: function(data){ 
					   var pWin = getTopWin(window).currentWin["add-topo"];
					   pWin.location.reload();
					   closewin();
				   }
				})
			};
				
			function closewin(){
				getTopWin(window).closejBox("add-topo");
			}
		</script>
	</head>

	<body>
		<form  name="resForm" id="resForm" >
			<div class="add_block">
				<input type="hidden" name="resId" id="resId" value="${res.id }" />
				<table class="table_eidt" id="restable">
					<tbody>
						<tr>
							<td class="td_left" style="width: 150px">资源名称：</td>
							<td class="td_right">
								<span id="presname">${res.name }</span> 
							</td>
						</tr>
						<tr>
							<td class="td_left" style="width: 150px">关联类型：</td>
							<td class="td_right">
								<input type="radio" name="type" value="1" checked="checked"/>基础资源
								<input type="radio" name="type" value="3"/>系统关联
							</td>
						</tr>
						<tr>
							<td class="td_left">关联拓扑：</td>
							<td class="td_right">
								<select id="topo" name="topo" multiple="multiple" size="1"  class="select" style="height:22px; text-align:center;" >
									<% List<TopuConf> topuConfList = (List<TopuConf>)request.getAttribute("topuConfList");
										  if(topuConfList!=null){
										      for(TopuConf topu:topuConfList){
										          out.println("<option value='"+topu.getId()+"'>"+topu.getName()+"</option>");
										      }
										  }
									%>
								</select>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div  class="btn-div" >
    			<button type="button" value="保存" onclick="add();" class="btn-4" >保存</button>
    			<input type="button" value="取消" onclick="closewin();" class="btn-4"/>
    	    </div>	
		</form>
	</body>
		
</html>
